-- wreckage
-- created by panyl
-- 地牢格子：残骸

return {
    restoreGrid = function(grid, info)
    end,

    autoFight = function(grid)
        -- 使用doEvent接口的残骸
        local eventTypes = {GRID_TYPE_CABIN, GRID_TYPE_SAILOR_WRECKAGE, GRID_TYPE_SHIPWRECK};
        if table.indexOf(eventTypes, grid.type) ~= -1 then
            return DungeonActionM.go("do_building_bonus", grid:getPos());
        end

        -- 领取残骸奖励
        if DungeonInstanceM.isInInstance() then
            -- 如果在副本中，走副本奖励流程
            return DungeonActionM.go("take_instance_bonus", grid:getPos());
        else
            -- 不在副本中，走通用奖励流程
            return DungeonActionM.go("take_wreckage_bonus", grid:getPos());
        end

        return false;
    end
};

